package persistence

import (
	"ruoyi/domain/repository"

	"gorm.io/gorm"
	"ruoyi/infrastructure/persistence/sysytmRepo"
)

type SystemRepositories struct {
	User     repository.SysUserRepository
	Config   repository.SysConfigRepository
	Dept     repository.SysDeptRepository
	Log      repository.SysLoginInfoRepository
	Menu     repository.SysMenuRepository
	Post     repository.SysPostRepository
	Role     repository.SysRoleRepository
	RoleDept repository.SysRoleDeptRepository
	RoleMenu repository.SysRoleMenuRepository
	UserPost repository.SysUserRepository
	UserRole repository.SysUserRoleRepository
	Dict     repository.SysDictDataRepository
	Notice   repository.SysNoticeRepository
	DictType repository.SysDictTypeRepository
}

func NewSystemRepositories(MysqlDb *gorm.DB) (*SystemRepositories, error) {

	return &SystemRepositories{
		User:     sysytmRepo.SysUserRepository(MysqlDb),
		Config:   sysytmRepo.SysConfigRepository(MysqlDb),
		Dept:     sysytmRepo.SysDeptRepository(MysqlDb),
		Log:      sysytmRepo.SysLoginInfoRepository(MysqlDb),
		Menu:     sysytmRepo.SysMenuRepository(MysqlDb),
		Post:     sysytmRepo.SysPostRepository(MysqlDb),
		Role:     sysytmRepo.SysRoleRepository(MysqlDb),
		RoleDept: sysytmRepo.SysRoleDeptRepository(MysqlDb),
		RoleMenu: sysytmRepo.SysRoleMenuRepository(MysqlDb),
		UserPost: sysytmRepo.SysUserRepository(MysqlDb),
		UserRole: sysytmRepo.SysUserRoleRepository(MysqlDb),
		Dict:     sysytmRepo.SysDictDataRepository(MysqlDb),
		Notice:   sysytmRepo.SysNoticeRepository(MysqlDb),
		DictType: sysytmRepo.SysDictTypeRepository(MysqlDb),
	}, nil
}
